package com.mobi.cacti.rabbit.response;

import java.util.ArrayList;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class ReqTicketDetailHandler extends DefaultHandler{
	
	private String tempVal;
	private ReqTicketDetail oClass;
	
	public ReqTicketDetail getObj() {
		return oClass;
	}
	
	public void startElement(String uri, String localName, String qName,Attributes attributes) throws SAXException {
		tempVal = "";
		
//		Log.i("tai",">>>" + localName);
		
		if (localName.equalsIgnoreCase("Ticket_No")) {
			oClass = new ReqTicketDetail();
		}
		
		
	}

	public void characters(char[] ch, int start, int length) throws SAXException {
		tempVal = new String(ch, start, length);
	}

	public void endElement(String uri, String localName, String qName) throws SAXException 
	{
//		Log.i("tai","<<<" + qName);

		if (qName.equalsIgnoreCase("Ticket_No")){
			oClass.ticketNo = tempVal;
		}
		else if (qName.equalsIgnoreCase("Ticket_Status")){
			oClass.ticketStatus = tempVal;
		}
		else if (qName.equalsIgnoreCase("FaultType_Cd")){
			oClass.faultTypeCode = tempVal;
		}
		else if (qName.equalsIgnoreCase("FaultDate")){
			oClass.faultDate = tempVal;
		}
		
	}

}
